//
//  HWRechargeNoteCell.m
//  嗨文
//
//  Created by 响当当 on 2019/2/15.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "HWRechargeNoteCell.h"

@interface HWRechargeNoteCell()
@property (nonatomic, strong)UIImageView *logoImageView;//logo图片
@property (nonatomic, strong)UILabel *titleLabel;//标题
@property (nonatomic, strong)UILabel *timeLabel;//时间
@property (nonatomic, strong)UILabel *moneyLabel;//钱
@end

@implementation HWRechargeNoteCell

- (UIImageView *)logoImageView
{
    if (!_logoImageView)
    {
        _logoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(15*kUIScaleBasePlus,21*kUIScaleBasePlus,33*kUIScaleBasePlus,27*kUIScaleBasePlus)];
    }
    return _logoImageView;
}

- (UILabel *)titleLabel
{
    if (!_titleLabel)
    {
        _titleLabel = [HWUtilties creatLabelWithFrame:CGRectMake(15*kUIScaleBasePlus,15*kUIScaleBasePlus,0,16*kUIScaleBasePlus)
                                         textAligment:NSTextAlignmentLeft
                                             textClor:LCHexColor(0x161616)
                                             textFont:16*kUIScaleBasePlus];
    }
    return _titleLabel;
}

- (UILabel *)timeLabel
{
    if (!_timeLabel)
    {
        _timeLabel = [HWUtilties creatLabelWithFrame:CGRectMake(15*kUIScaleBasePlus,41*kUIScaleBasePlus,0,11*kUIScaleBasePlus)
                                         textAligment:NSTextAlignmentLeft
                                             textClor:LCHexColor(0x6E6E6E)
                                             textFont:12*kUIScaleBasePlus];
    }
    return _timeLabel;
}

- (UILabel *)moneyLabel
{
    if (!_moneyLabel)
    {
        _moneyLabel = [HWUtilties creatLabelWithFrame:CGRectMake(0,27*kUIScaleBasePlus,0,13*kUIScaleBasePlus)
                                         textAligment:NSTextAlignmentCenter
                                             textClor:LCHexColor(0x161616)
                                             textFont:18*kUIScaleBasePlus];
    }
    return _moneyLabel;
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
//        [self.contentView addSubview:self.logoImageView];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.timeLabel];
        [self.contentView addSubview:self.moneyLabel];

    }
    return self;
}

#pragma mark - 获取充值记录数据
- (void)getRechargeNoteDate:(HWRechargeNoteModel *)model
{
//    self.logoImageView.image = [UIImage imageNamed:dic[@"logo"]];
    
    self.titleLabel.text = model.note;
    [self.titleLabel sizeToFit];
    
    self.timeLabel.text = model.payTime;
    [self.timeLabel sizeToFit];
    
    self.moneyLabel.text = model.goodsNum;
    [self.moneyLabel sizeToFit];
    [self.moneyLabel setX:SCREEN_WIDTH-17*kUIScaleBasePlus-self.moneyLabel.frame.size.width];
}

- (void)getConumeDate:(HWConsumeModel *)model
{
    self.titleLabel.text = model.note;
    [self.titleLabel sizeToFit];
    
    self.timeLabel.text = model.consumTime;
    [self.timeLabel sizeToFit];
    
    self.moneyLabel.text = model.bookCoin;
    [self.moneyLabel sizeToFit];
    [self.moneyLabel setX:SCREEN_WIDTH-17*kUIScaleBasePlus-self.moneyLabel.frame.size.width];
}
@end
